import 'package:appflutterhomeschool/common/common.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

//圆形图片展示
class ImageWidget extends StatelessWidget {
  final String imageUrl;

  ImageWidget({this.imageUrl});

  @override
  Widget build(BuildContext context) {
    return CircleAvatar(
      //头像半径
      radius: ScreenUtil().setWidth(22.5),
      //头像图片 -> NetworkImage网络图片，AssetImage项目资源包图片, FileImage本地存储图片
      backgroundImage: NetworkImage(
          imageUrl == "" || imageUrl == null || imageUrl.isEmpty
              ? Constant.nullImage
              : imageUrl),
    );
  }
}
